package com.cencat.driver.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 路由实体类
 * 
 * @author cencat
 * @since 2024-01-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_route")
public class Route implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 路由ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 路由编码
     */
    @TableField("route_code")
    private String routeCode;

    /**
     * 路由名称
     */
    @TableField("route_name")
    private String routeName;

    /**
     * 起点
     */
    @TableField("start_point")
    private String startPoint;

    /**
     * 终点
     */
    @TableField("end_point")
    private String endPoint;

    /**
     * 路由距离(公里)
     */
    @TableField("distance")
    private BigDecimal distance;

    /**
     * 预计时长(分钟)
     */
    @TableField("estimated_duration")
    private Integer estimatedDuration;

    /**
     * 路由状态：0-禁用，1-启用
     */
    @TableField("status")
    private Integer status;

    /**
     * 分配的司机ID
     */
    @TableField("driver_id")
    private Long driverId;

    /**
     * 路由描述
     */
    @TableField("description")
    private String description;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除：0-未删除，1-已删除
     */
    @TableLogic
    @TableField("deleted")
    private Integer deleted;
}